//
// Created by Admin on 2020/12/8.
//
#include "JNITest.h"
#include "jni.h"
#include <string>
#include <stdio.h>
#include "Test.h"

Test test;
jint temp;

extern "C" JNIEXPORT jstring JNICALL
Java_com_example_androidmk_JNITest_get(JNIEnv* env, jclass){
    std::string tempStr = std::to_string(test.getTemp());
    std::string hello = "Hello from C++" + tempStr;
    return env->NewStringUTF(hello.c_str());
}



extern "C"
JNIEXPORT void JNICALL
Java_com_example_androidmk_JNITest_print(JNIEnv *env, jclass clazz, jint value) {
    // TODO: implement print()
    printf("the value is : %d",value);
    test.setTemp(value);
    temp = value;

}